<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>订单列表</title>
<style type="text/css">
* {
	font-size: 11pt;
}

div {
	border: 2px solid gray;
	width: 75px;
	height: 75px;
	text-align: center;
}

li {
	margin: 10px;
}

img {
	height: 70px;
	width: 70px;
}
</style>
</head>
<body>
	<table border="1" width="100%" cellspacing="0" background="black">
		<c:forEach items="${orderList }" var="order">
			<tr bgcolor="gray" bordercolor="gray">
				<td colspan="6">
					订单编号：${order.oid }　　成交时间：<fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${order.ordertime }"/>
					　　金额：<font color="red"><b>${order.total }元　　</b></font>
					<c:choose>
						<c:when test="${order.state eq 1 }">
							<a href="<c:url value='/OrderServlet?method=load&oid=${order.oid }'/>">付款</a>
						</c:when>
						<c:when test="${order.state eq 2 }">等待发货</c:when>
						<c:when test="${order.state eq 3 }">
							<a href="<c:url value='/OrderServlet?method=confirm&oid=${order.oid }'/>">确认收货</a>
						</c:when>
						<c:when test="${order.state eq 4 }">交易成功</c:when>
					</c:choose>
				</td>
			</tr>
			
			<c:forEach items="${order.orderItemList }" var="orderItem">
				<tr bordercolor="gray" align="center">
					<td width="15%">
						<div><img src="<c:url value='/${orderItem.book.image }'/>" height="75"></div>
					</td>
					<td>书名：${orderItem.book.bname }</td>
					<td>作者：${orderItem.book.author }</td>
					<td>单价：${orderItem.book.price }元</td>
					<td>数量：${orderItem.count }</td>
					<td>小计：${orderItem.subtotal }元</td>
				</tr>
			</c:forEach>
		</c:forEach>
	</table>
</body>
</html>